//////////////////////////////////////////////////////////////////////////
// boundtopology - class to hold information about topology of boundary
// By Antonio Miranda - Fev 2013
//////////////////////////////////////////////////////////////////////////

#ifndef _IDENTIFY_CRACK_H
#define _IDENTIFY_CRACK_H

#include <vector>
#include "ctopology/topology.hpp"
#include "geom/matrix4x4.h"


using namespace std;

//
//////////////////////////////////////////////////////////////////////////
class identifyCrack
{
public:
  identifyCrack(cTopology *boudMesh);
  ~identifyCrack (void);


  // easy accesses
  //////////////////////////////////////////////////////////////////////////


private:
  
  // boundary topology
  cTopology     *m_surfTopol;

  // try to identify surfaces by edges of model
  // this function also identify edges on crack tip
  void identifySurfaces ( );

  // identify cracks
  void identifyCracks ( );
  
  // mark elements/triangles/surfaces with flag
  void markSurfaces (vector<int> ids, int flag);
  
  // compute matrix transformation
  void makeCrackTransf    ( );
  void computeCrackTransf (int id_crack, int id_pos, int id_tang0, int id_tang1);
  

  // all edges in crack tip
  vector<int> m_crackEdges;

  // crack faces
  vector< vector<int> > m_crackFaces;
  
  // crack front
  vector< vector<int> >       m_crackFront;  // id points
 
    

};

#endif
